Defines a neuron which uses unlimited number of rules to determine how the unlimited number of input patterns are processed and what output pattern is produced in this process. Neurons are activated with run-neuron. The neuron definition can also contain the descriptions out-range and otherwise.
- otherwise is used if none of the rules are fired.
(def-neuron test3
(and (in 1 'a) (in 2 'a)) ; test
'a ; fire if true
(and (in 1 'b) (in 2 'a) (out 'a -1))
'x
(otherwise '=)
)
(run-neuron 'test3
'(a b a d b)
'(a a b a a))
--> (a x = = x)
If you want to hide a neuron inside a Lisp function this is done with:
(defun neuron-function (&rest l)
(apply 'run-neuron 'test3 l))
(neuron-function '(a b a d b) '(a a b a a))
--> (a x = = x)
(out-range below higher)
- out-range defines what symbols are returned if in and out positions are outside the source pattern. Below is used when in or out tries to access symbols below the first symbol, and the higher value is used when they try to access symbols higher than the last symbol in the pattern.